import { uniFetch  } from '../utils/Ajax'
import { uniConfig } from '../config/index'
const appId = uniConfig.appId
const basePath = uniConfig.prodPath

export function getCouponList(data : any) {
    return uniFetch.uniPost({
            query: {
            ...data
            }
        },
        basePath + "/zt/member/coupon/list"
    )
}

export function queryCoupon(data : any) {
    return uniFetch.uniGet({
        query: {
            ...data
        }
        },
        basePath + "/member/coupon/query"
    )
}

export function bindCoupon(data :any) {
    return uniFetch.uniGet({
        query: {
            ...data
        }
        },
        basePath + "/member/coupon/bind"
    )
}

/**
 * 
 * @param {获取订单可使用券，王者荣耀专题} data 
 * @returns 
 */
export function queryCouponByOrder(data : any) {
    return uniFetch.uniPost({
        query: {
            ...data
            }
        },
        basePath + "/zt/member/order/coupon/list"
    )
}
/**
 * 
 * @param {使用优惠券} data 
 * @returns 
 */
export function useCoupon(data : any) {
    return uniFetch.uniPost({
        query: {
            ...data
        }
        },
        basePath + "/zt/member/order/useCoupon"
    )
}

/**
 * 
 * @param {移除券使用} data 
 * @returns 
 */
export function removeUse(data : any) {
    return uniFetch.uniGet({
        query: {
            ...data
        }
        },
        basePath + "/order/coupon/removeUse"
    )
}

/**
 * 
 * @param {取消使用优惠券} data 
 * @returns 
 */
export function cancelUseCoupon(data : any) {
    return uniFetch.uniGet({
        query: {
            ...data
        }
        },
        basePath + "/order/coupon/cancelUse"
    )
}

/**
 * 
 * @param {获取微信分享、扫码相关配置的信息} data 
 * @returns 
 */
export function getWxScanParams(data : any) {
    return uniFetch.uniGet({
        query: {
            ...data
        }
        },
        basePath + "/wx/cfg/params"
    )
}

/**
 * 
 * @param {获取指定标签的套票列表} data 
 * @returns 
 */
export function getCouponListBy_ztTag(data : any) {
    return uniFetch.uniGet({
        query: {
            ...data
        }
        },
        basePath + "/zt/product/list"
    )
}